﻿using System;
using System.Windows;
using System.Windows.Media;
using Trackr.Helpers;

namespace Trackr
{
	/// <summary>
	/// Interaction logic for NotificationWindow.xaml
	/// </summary>
	public partial class NotificationWindow : Window, IView
	{
		Brush defaultBlueBrush = (SolidColorBrush)(new BrushConverter().ConvertFrom("#FF4B95D8"));
		public NotificationWindow()
		{
			InitializeComponent();
			this.DataContext = new ViewModel.NotificationViewModel<NotificationWindow>(this);

			var app = Application.Current as App;
			app.TimeElapsed += (o) =>
			{
				Dispatcher.Invoke(() =>
				{
					this.BorderMain.Background = defaultBlueBrush;
				});
			};
			app.TimeOut += (o) =>
			{
				Dispatcher.Invoke(() =>
				{
					this.BorderMain.Background = Brushes.OrangeRed;
				});
			};
		}

	}
}
